package com.adee.util;

import java.util.concurrent.TimeUnit;

public class Utils {
    public static String hello2 = "hello2";
    public static void sleep(int i) {
        try {
            TimeUnit.SECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    public static void sleepMills(int i) {
        try {
            TimeUnit.MILLISECONDS.sleep(i);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void print(int[] arr) {
        if(arr == null || arr.length == 0) {
            System.out.println("[]");
        } else {
            StringBuilder b = new StringBuilder("[");
            int len = arr.length;
            int end = len -1;
            for (int i = 0; i < len; i++) {
                b.append(arr[i]);
                if(i != end) b.append(",");
            }
            String s = b.append("]").toString();
            System.out.println(s);
        }
    }
}
